import 'package:flutter/material.dart';
import 'package:flutter_boost/flutter_boost.dart';
import 'package:xiongmao_clean_flutter_module/business/common/insure/page/Insure_page.dart';
import 'package:xiongmao_clean_flutter_module/business/common/todo/page/todo_page.dart';
import 'package:xiongmao_clean_flutter_module/business/common/workpost/page/work_add_post_page.dart';
import 'package:xiongmao_clean_flutter_module/business/common/workpost/page/work_post_page.dart';
import 'package:xiongmao_clean_flutter_module/business/common/workpost/page/work_rules_page.dart';

import '../../../net/http_config.dart';

/// 定义页面名称
const workPostPage = "workPostPage";

const addWorkPost = "addWorkPost";

///用工规则
const workRulesPage = "workRulesPage";

/// 根据页面名称定义对应的页面对象，相当于activity的路由
Map<String, FlutterBoostRouteFactory> workPostRouterMap = {
  workPostPage: (settings, uniqueId) {
    return MaterialPageRoute(
        settings: settings,
        builder: (_) {
          Map<String, dynamic> map = settings.arguments != null ? settings.arguments as Map<String, dynamic> : {};
          httpConfig.initHttpParams(map);
          return WorkPostPage();
        });
  },
};

/// 根据页面名称定义对应的页面对象，相当于activity的路由
Map<String, FlutterBoostRouteFactory> workAddPostRouterMap = {
  addWorkPost: (settings, uniqueId) {
    return MaterialPageRoute(
        settings: settings,
        builder: (_) {
          Map<String, dynamic> map = settings.arguments != null ? settings.arguments as Map<String, dynamic> : {};
          httpConfig.initHttpParams(map);
          String? uuid = map["uuid"];
          String? work_name = map["work_name"];
          String? work_salary = map["work_salary"];
          return WorkAddPostPage(
            uuid: uuid,
            work_name: work_name,
            work_salary: work_salary,
          );
        });
  },
};

///用工规则
Map<String, FlutterBoostRouteFactory> workRulesRouterMap = {
  workRulesPage: (settings, uniqueId) {
    return MaterialPageRoute(
        settings: settings,
        builder: (_) {
          Map<String, dynamic> map = settings.arguments != null ? settings.arguments as Map<String, dynamic> : {};
          httpConfig.initHttpParams(map);
          return WorkRulesPage();
        });
  },
};
